//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#ifndef __MESH_SWITCH_OUTER_H_
#define __MESH_SWITCH_OUTER_H_

#include <omnetpp.h>
#include "packet_m.h"

using namespace omnetpp;

/**
 * TODO - Generated class
 */
class Outer : public cSimpleModule
{
private:
    simsignal_t latencySingal;
    simsignal_t sendSingal;
    simsignal_t recvSingal;
    simsignal_t sendBitSingal;
    simsignal_t recvBitSingal;
    simsignal_t hopSingal;
    simsignal_t sendTimeSingal;
    simsignal_t recvTimeSingal;
protected:
    virtual void initialize() override;
    virtual void handleMessage(cMessage *msg) override;
    virtual Packet *generateMessage();
    virtual void refreshDisplay() const override;

    // 定义Adie的坐标
    std::vector<std::vector<int>> A_dies;

    // 链路速率
    double DELAY;

    // 用于数据统计
    long send_packet_num;
    long recv_packet_num;
    long bitLengthSend;
    long bitLengthRecv;
    long hop;
    simtime_t latency;
    simtime_t sendTime;
    simtime_t recvTime;

};

#endif
